import { FishBaseController } from "./FishBaseController";
import { MiniGameObject } from "../../MiniGameObject";
import { Obstacle } from "../Obj/Obstacle";
type int = number;
//class ObstacleController
    
    export  class ObstacleController extends FishBaseController
    {
        constructor(arg1: number=0, arg2: int=1)
        {
            super();
            this._xSpeed = arg1;
            this._horizontalDirection = arg2;
            return;
        }

        public /* override */ set target(arg1: MiniGameObject)
        {
            if (typeof arg1 === "obstacle") 
            {
                super.target = arg1;
            }
            return;
        }

        public /* override */ autoRun(): void
        {
            if ((_target as Obstacle).isInShake) 
            {
                (_target as Obstacle).xSpeed = 0;
            }
            else 
            {
                (_target as Obstacle).xSpeed = this._xSpeed;
                (_target as Obstacle).horizontalDirection = this._horizontalDirection;
            }
            return;
        }

        /* internal */ /* var */_xSpeed: number;

        /* internal */ /* var */_horizontalDirection: int;
    }
